﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Work2
{
    public partial class FrmSearch : Form
    {
        public FrmSearch()
        {
            InitializeComponent();
            this.skinEngine1 = new Sunisoft.IrisSkin.SkinEngine(((System.ComponentModel.Component)(this)));
            this.skinEngine1.SkinFile = Application.StartupPath + "//Calmness.ssk";
        }
        DataSet ds = new DataSet();
        DataView dv = null;
      

        private void BtnClose_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确认退出系统？", "提示", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }
            Application.Exit();
        }



        private void FrmSearchAsset_Load_1(object sender, EventArgs e)
        {
            dgvAsset.RowsDefaultCellStyle.BackColor = Color.White;
            string conStr = @"Data Source=LAPTOP-LER1MVBI\SQLEXPRESS;Initial Catalog=电子族谱系统;uid=sa;pwd=zxcvbnm123";
            SqlConnection conn = new SqlConnection(conStr);
            string sql = "select * from Egenealogy";
            SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);
            adapter.Fill(ds, "族谱信息");
            dv = ds.Tables["族谱信息"].DefaultView;
            dgvAsset.DataSource = dv;
        }

        private void Label1_Click_1(object sender, EventArgs e)
        {

        }

        private void Button5_Click(object sender, EventArgs e)
        {
            FrmSearchMate fr = new FrmSearchMate(txtAssetName);
            fr.MdiParent = this.MdiParent;
            fr.Show();
        }

        private void Button1_Click_1(object sender, EventArgs e)
        {
            if (MessageBox.Show("确认退出系统？", "提示", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }
            Application.Exit();
        }

        private void Button4_Click(object sender, EventArgs e)
        {
            FrmSeachchild frm = new FrmSeachchild(txtAssetName);
            frm.MdiParent = this.MdiParent;
            frm.Show();
        }

        private void Button3_Click(object sender, EventArgs e)
        {
            FrmSearchFather frmNewSearch = new FrmSearchFather(txtAssetName);
            frmNewSearch.MdiParent = this.MdiParent;
            frmNewSearch.Show();
        }

        private void TxtAssetName_TextChanged(object sender, EventArgs e)
        {

        }

        private void DgvAsset_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }
    }
    }

